package org.hong.monkey.status.api.v1

import javax.ws.rs.{PathParam, GET, Produces}
import javax.ws.rs.core.MediaType

import org.hong.monkey.ui.MonkeyUI

@Produces(Array(MediaType.APPLICATION_JSON))
private[v1] class OneRDDResource(ui: MonkeyUI) {

  @GET
  def rddData(@PathParam("rddId") rddId: Int): RDDStorageInfo = {
    AllRDDResource.getRDDStorageInfo(rddId, ui.storageListener, true).getOrElse(
      throw new NotFoundException(s"no rdd found w/ id $rddId")
    )
  }

}
